Skip to content

feat: command bar #2881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 159 commits into from
Aug 18, 2025
Merged

feat: command bar #2881

merged 159 commits into from
Aug 18, 2025

Conversation

AbhishekA1509
Copy link
Member

@AbhishekA1509 AbhishekA1509 commented Aug 13, 2025

Description

This PR replaces the existing command bar implementation with a new CommandBar component. The change involves removing the old command infrastructure and implementing a modern command bar with improved navigation and recent action tracking.

Removes the old command component architecture and related utilities
Implements a new CommandBar component with React hooks and modern patterns
Adds support for recent navigation actions and keyboard shortcuts

Fixes https://github.com/devtron-labs/sprint-tasks/issues/2539

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

AbhishekA1509 and others added 30 commits July 8, 2025 13:35
- Removed unused properties and methods from TriggerViewContext and TriggerViewState interfaces.
- Updated TriggerViewContextType to simplify context management.
- Cleaned up CIMaterialState and related interfaces.
- Adjusted WorkflowProps to include openCIMaterialModal function.
- Modified TriggerCINode to utilize openCIMaterialModal instead of context.
- Enhanced processCIMaterialResponse to ensure type safety with CIMaterialType.
- Updated getCIMaterialList function parameters for better clarity.
- Removed unused route WEBHOOK_RECEIVED_PAYLOAD_ID from routes configuration.
- Updated the logic to correctly set the `isSelected` property of the material to ensure the correct material state is maintained.
- Modified the `setMaterialList` function to set `isMaterialLoading` for the selected material while leaving other properties unchanged, improving the loading state handling during material fetching.
- Refactored GitInfoMaterial to support bulk CI triggering, including handling of multiple applications and their respective states.
- Introduced new service functions for triggering builds and managing errors.
- Added utility functions for payload generation and validation of materials.
- Updated TriggerBuildSidebar to render application-specific materials and cache options.
- Implemented new types and interfaces for better type safety and clarity.
- Enhanced user experience with informative tooltips and error handling for CI configurations.
…ror handling, state management, and UI updates
…egex value and improve BuildImageHeader layout
@AbhishekA1509 AbhishekA1509 requested a review from Copilot August 13, 2025 10:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the existing command bar implementation with a new CommandBar component. The change involves removing the old command infrastructure and implementing a modern command bar with improved navigation and recent action tracking.

  • Removes the old command component architecture and related utilities
  • Implements a new CommandBar component with React hooks and modern patterns
  • Adds support for recent navigation actions and keyboard shortcuts

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.

File Description
src/components/common/navigation/Navigation.tsx Removes old Command component integration and adds new CommandBar component
src/components/command/* Removes entire old command implementation including types, utilities, and components
src/Pages/Shared/CommandBar/* Adds new CommandBar implementation with TypeScript types, constants, and components
package.json Removes flexsearch dependency that was used by the old command system

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

queryKey: ['recentNavigationActions'],
select: ({ result }) =>
result.commandBar.recentNavigationActions.reduce<CommandBarGroupType>((acc, action) => {
const requiredGroup = structuredClone(NAVIGATION_GROUPS).find((group) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const requiredGroup = structuredClone(NAVIGATION_GROUPS).find((group) =>
const requiredGroup = NAVIGATION_GROUPS.find((group) =>

structuredClone is not required

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutating requiredGroup id which will mess up NAVIGATION_GROUPS const

if (requiredGroup) {
const requiredItem = requiredGroup.items.find((item) => item.id === action.id)
requiredItem.id = `${RECENT_NAVIGATION_ITEM_ID_PREFIX}${action.id}`
acc.items.push(structuredClone(requiredItem))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
acc.items.push(structuredClone(requiredItem))
acc.items.push(requiredItem)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have removed in next PR

acc.items.push(structuredClone(requiredItem))
}
return acc
}, structuredClone(RECENT_ACTIONS_GROUP)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}, structuredClone(RECENT_ACTIONS_GROUP)),
}, RECENT_ACTIONS_GROUP),

Elessar1802 and others added 4 commits August 14, 2025 12:49
feat: remove duplication between EnvTrigger and TriggerView regarding Deploy and Bulk Deploy
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@AbhishekA1509 AbhishekA1509 merged commit 97966a8 into kubecon-2025 Aug 18, 2025
4 of 5 checks passed
@AbhishekA1509 AbhishekA1509 deleted the feat/command-bar branch August 18, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants